package com.surfacing.rcp.client.perspectives;

import org.eclipse.jface.resource.ImageDescriptor;

import com.surfacing.rcp.client.modelManager.SessionManager;
import com.surfacing.rcp.model.factory.ImageFactory;

/**
 * Switches to the journal perspective
 * 
 * @author Michael
 */
public class SwitchToAdminPerspective extends AbstractPerspectiveSwitcher {

	private String authorization = "Benutzer";

	public SwitchToAdminPerspective() {

		super(AdminPerspective.ID);
	}

//	@Override
//	public boolean isEnabled() {
//		{
//			if (SessionManager.getInstance().getLoginInformation() != null) {
//				authorization = SessionManager.getInstance()
//						.getLoginInformation().getAuthorization();
//			}
//		}
//		{
//			if (!authorization.equalsIgnoreCase("Administrator")) {
//				return false;
//			} else {
//				return true;
//			}
//		}
//	}

	/**
	 * Returns the image for the perspective
	 */
	@Override
	public ImageDescriptor getImageDescriptor() {
		return ImageFactory.getInstance().getRegisteredImageDescriptor(
				"toolbar.transportJournal");
	}

	/**
	 * Returns the text to render
	 */
	@Override
	public String getText() {
		return "Administrator";
	}

	/**
	 * The tooltip text
	 */
	@Override
	public String getToolTipText() {
		return "Erweiterte Einstellungen";
	}
}